package com.naiterui.ehp.bs.doctor.enums;

/**
 * OCR 识别状态匹配
 */
public enum OcrIdentifyEnum {

    /**
     * 返回状态 匹配审核类型
     */
    NORMAL("normal", 2, "识别正常"),
    REVERSED_SIDE("reversed_side", 3, "身份证正反面颠倒"),
    NON_IDCARD("non_idcard", 3, "上传的图片中不包含身份证"),
    BLURRED("blurred", 3, "身份证模糊"),
    OTHER_TYPE_CARD("other_type_card", 3, "其他类型证照"),
    OVER_EXPOSURE("over_exposure", 3, "身份证关键字段反光或过曝"),
    OVER_DARK("over_dark", 3, "身份证欠曝（亮度过低）"),
    COPY("copy", 3, "复印件"),
    TEMPORARY("temporary", 3, "临时身份证"),
    SCREEN("screen", 1, "翻拍"),
    UNKNOWN("unknown", 1, "未知状态");

    private String status;

    /**
     * 类型: 1 人工审核 2 通过 3:失败
     */
    private Integer type;

    private String details;

    OcrIdentifyEnum(String status, int type, String details) {
        this.status = status;
        this.type = type;
        this.details = details;
    }

    public static Integer getTypeResult(String status) {
        OcrIdentifyEnum[] enumConstants = OcrIdentifyEnum.class.getEnumConstants();
        for (OcrIdentifyEnum tempEnum : enumConstants) {
            if (tempEnum.getStatus().equals(status)) {
                return tempEnum.getType();
            }
        }
        return null;
    }

    public static String getDetailResult(String status) {
        OcrIdentifyEnum[] enumConstants = OcrIdentifyEnum.class.getEnumConstants();
        for (OcrIdentifyEnum tempEnum : enumConstants) {
            if (tempEnum.getStatus().equals(status)) {
                return tempEnum.getDetails();
            }
        }
        return null;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public int getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getDetails() {
        return details;
    }

    public void setDetails(String details) {
        this.details = details;
    }
}
